package com.asimplefox.service.impl;

import com.asimplefox.entity.Articles;
import com.asimplefox.mapper.ArticlesMapper;
import com.asimplefox.service.IArticlesService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 *
 * @author kloping
 * @since 2024-11-26
 */
@Service
public class ArticlesServiceImpl extends ServiceImpl<ArticlesMapper, Articles> implements IArticlesService {
    @Override
    public Object pageList(Integer pageNum, Integer pageSize) {
        QueryWrapper<Articles> qw = new QueryWrapper<>();
        qw.select("id", "title", "image_url", "created");
        Page<Articles> pages = page(new Page<>(pageNum, pageSize), qw);
        return pages;
    }
}
